
package net.wofly.common.util;

import java.io.File;

/**
 * 图片类型地址
 *
 * @author siqingwei
 * @date 2018/3/11
 */
public enum FileTypeAddress {

    商品图片(1, File.separator + "static" + File.separator + "images" + File.separator + "commodity"),
    // /images/headPic/年/月/
    头像图片(2, File.separator + "static" + File.separator + "images" + File.separator + "headPic"),
    // /images/signin/年/月/
    签到图片(3, File.separator + "static" + File.separator + "images" + File.separator + "signin"),
    // /images/stock/instock/年/月/
    入库单据图片(4, File.separator + "static" + File.separator + "images" + File.separator + "stock" + File.separator + "instock"),
    // /images/stock/outstock/年/月/
    出库单据图片(5, File.separator + "static" + File.separator + "images" + File.separator + "stock" + File.separator + "outstock"),
    // /images/payPic/outstock/年/月/
    支付单据图片(6, File.separator + "static" + File.separator + "images" + File.separator + "payInfoPic"),
	// /images/finance/expense/
    报销图片(7, File.separator + "static" + File.separator + "images" + File.separator + "finance" + File.separator + "expense");

    private Integer value;
    private String address;

    FileTypeAddress(Integer value, String address) {
        this.value = value;
        this.address = address;
    }

    public static boolean isValueCorrect(Integer value) {
        for (FileTypeAddress forEnum : values()) {
            if (forEnum.getValue().equals(value)) {
                return true;
            }
        }
        return false;
    }

    public static String getAddress(Integer value) {
        for (FileTypeAddress forEnum : values()) {
            if (value.equals(forEnum.getValue())) {
                return forEnum.address;
            }
        }
        return null;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
}
